
; SysPic Installer Script
; $VER: Install SysPic 1.0 (14.12.95)
; (c) Grzegorz Calkowski / TBR

; =======================================================================

; Strings

(set #kick39 "SysPic requires at least Kickstart 3.0 (v39) !")
(set #syspicdir "Select drawer for SysPic executable")
(set #closepicdir "Select drawer for ClosePic")
(set #askbonus "\nDo you want to install bonus pictures?")
(set #bonusdir "Select drawer for pictures")
(set #selpics "Select what pictures to install")
(set #messy "\nSysPic has been installed.\n\nNow you have to edit startup-sequence by hand -\ninsert 'SysPic <filename> <options>' command\nright after 'SetPatch' command.\n\nConsult the documentation for details.")

; =======================================================================

(if (< (/ (getversion) 65536) 39)
	(abort #kick39)
)

(set cpu (database "cpu"))
(set prgver "SysPic")
(set picsdir "")

; Determine SysPic version

(if (OR (= cpu "68020") (= cpu "68030"))
	(set prgver "SysPic.020")
	(if (>= cpu "68040")
		(set prgver "SysPic.040")
	)
)

(if (exists 'C2:' (noreq))
	(set destdir "C2:")
	(set destdir "C:")
)

(copyfiles
	(source (cat "C/" prgver))
	(dest (set destdir (askdir
		(help @askdir-help)
		(default destdir)
		(prompt #syspicdir)
	)))
	(newname "SysPic")
	(help @copyfiles-help)
)

(set @default-dest destdir)

(copyfiles
	(source "WBStartup/ClosePic")
	(dest (askdir
		(prompt #closepicdir)
		(help @askdir-help)
		(default 'SYS:WBStartup')
	))
	(infos)
	(help @copyfiles-help)
)

(if (askbool
	(prompt #askbonus)
	(help ""))

	(copyfiles
		(prompt #selpics)
		(source "Bonus")
		(pattern "#?.ilbm")
		(dest (set picsdir (askdir
			(prompt #bonusdir)
			(help @askdir-help)
			(default 'SYS:Prefs/Presets')
		)))
		(confirm)
		(help @copyfiles-help)
	)
)

(message #messy)

